const http = require('http')
process.on('uncaughtException', err => {
	console.log(err);
});
process.on('message', message => {
	console.log(`child receive message :${message}`)
	process.send('hello my master');
})
const server = http.createServer((req, res) => {
	res.writeHead(200, {
		'Content-Type': 'text/plain'
	})
	res.end('hello\n')
})
let port = Math.round((1 + Math.random()) * 1000);
server.listen(port, err => {
	if (err) {
		console.log(err)
		return;
	}
	console.log(`server start at port${port}`);
})